package com.danskin.wechat.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.danskin.wechat.dao.WxFansCardDao;
import com.danskin.wechat.service.WxFansCardService;
import com.danskin.wechat.util.LogUtil;
import com.danskin.wechat.util.Page;
import com.danskin.wechat.vo.WxFansCardDetailVo;
import com.danskin.wechat.vo.WxFansCardVo;

@Service
public class WxFansCardServiceImpl implements WxFansCardService {

	@Autowired
	private WxFansCardDao wxFansCardDao;
	@Override
	public List<WxFansCardVo> selectWxFansCardList(Map map ) {
		LogUtil.info("========根据时间查询微信原生卡领取统计参数："+ToStringBuilder.reflectionToString(map));
		List<WxFansCardVo> fansCardVoList = new ArrayList<WxFansCardVo>();
		
		try {
			fansCardVoList = wxFansCardDao.selectWxFansCardList(map);
		} catch (Exception e) {
			LogUtil.error("=======根据时间查询微信原生卡领取统计异常", e);
		}
		return fansCardVoList;
	}

	@Override
	public List<WxFansCardDetailVo> listPageWxFansCardDetailList(Page page) {
		LogUtil.info("========根据时间查询微信原生卡领取详情参数："+ToStringBuilder.reflectionToString(page));
		
		List<WxFansCardDetailVo> fansCardDetailVoList = new ArrayList<WxFansCardDetailVo>();
		
		try {
			fansCardDetailVoList = wxFansCardDao.listPageWxFansCardDetailList(page);
		} catch (Exception e) {
			LogUtil.error("=======根据时间查询微信原生卡领取详情异常", e);
		}
		return fansCardDetailVoList;
	}

	@Override
	public List<WxFansCardDetailVo> selectWxFansCardDetailList(Map map) {
		LogUtil.info("========根据时间查询微信原生卡领取详情（用于导出）参数："+ToStringBuilder.reflectionToString(map));
		
		List<WxFansCardDetailVo> fansCardDetailVoList = new ArrayList<WxFansCardDetailVo>();
		
		try {
			fansCardDetailVoList = wxFansCardDao.selectWxFansCardDetailList(map);
		} catch (Exception e) {
			LogUtil.error("=======根据时间查询微信原生卡领取详情（用于导出）异常", e);
		}
		return fansCardDetailVoList;
	}

}
